package com.example.company.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.company.entity.Leaves;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 存储员工请假信息Mapper接口
 *
 * @author ruoyi
 * @date 2024-12-30
 */
public interface LeavesMapper extends BaseMapper<Leaves> {
	
	/**
	 * 查询存储员工请假信息
	 *
	 * @param LeaveID 存储员工请假信息主键
	 * @return 存储员工请假信息
	 */
	Leaves selectLeavesByLeaveID(Long LeaveID);
	
	/**
	 * 查询存储员工请假信息列表
	 *
	 * @param leaves 存储员工请假信息
	 * @return 存储员工请假信息集合
	 */
	List<Leaves> selectLeavesList(Leaves leaves);
	
	/**
	 * 新增存储员工请假信息
	 *
	 * @param leaves 存储员工请假信息
	 * @return 结果
	 */
	int insertLeaves(Leaves leaves);
	
	/**
	 * 修改存储员工请假信息
	 *
	 * @param leaves 存储员工请假信息
	 * @return 结果
	 */
	int updateLeaves(Leaves leaves);
	
	/**
	 * 删除存储员工请假信息
	 *
	 * @param LeaveID 存储员工请假信息主键
	 * @return 结果
	 */
	int deleteLeavesByLeaveID(Long LeaveID);
	
	/**
	 * 批量删除存储员工请假信息
	 *
	 * @param LeaveIDs 需要删除的数据主键集合
	 * @return 结果
	 */
	int deleteLeavesByLeaveIDs(Long[] LeaveIDs);
	@Update("update company.leaves set leavestatus='批准' where leaves.leaveid=#{leaveid}")
	int updateByleaveid(Integer leaveid);
	
	@Update("update company.leaves set leavestatus='不批准' where leaves.leaveid=#{leaveid}")
	int updateByleaveidtono(Integer leaveid);
}
